Add ParamProtocol "Base + Bonus" reward example #72
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pyth Examples Contribution
Type of Contribution
Project Information
Project/Example Name:
Param Protocol: Hybrid "Base + Bonus" Reward ModelPyth Product Used:
Blockchain/Platform:
Description
What does this contribution do?
This PR adds a new example project,
ParamProtocol, which demonstrates an innovative incentive model for a data monetization platform.The contribution consists of a single
ParamProtocol.solfile which conveniently includes:ParamProtocolcontract (an ERC721 + Pyth Entropy consumer).MockPTKcontract (an ERC20 + AccessControl) for easy deployment and testing of the reward token.How does it integrate with Pyth?
This contract uses Pyth Entropy to power a probabilistic bonus reward system.
IEntropyConsumerinterface.mintDataNFTfunction ispayable. When called, it usespyth.getFeeV2()to get the current fee and then callspyth.requestV2{value: msg.value}()to request a random number.entropyCallbackfunction, which receives therandomNumberfrom the Pyth network.randomNumberis then used in a_calculateBonusRewardfunction to determine a tiered, probabilistic bonus (Common, Rare, or Legendary), which is then minted to the user.What problem does it solve or demonstrate?
This project demonstrates an innovative solution to the user incentive problem for data contribution platforms.
This creates a system that is both trustworthy (guaranteed value) and exciting (a provably-fair chance at a jackpot), all powered by Pyth.
Directory Structure (for new examples)
Testing & Verification
How to Test This Contribution
These instructions are for testing on Base Sepolia using Remix IDE.
Prerequisites
Setup & Run Instructions
Deployment Information (if applicable)
Network:
Base SepoliaContract Address(es):
Added in the README
Demo URL:
ON ETHONLINE project pageChecklist
Code Quality
Testing
Additional Context
Related Issues
Fixes #### Screenshots/Demo (if applicable)
Notes for Reviewers
This is a submission for the ETHGlobal Hackathon Pyth Entropy prize. The core innovation is the "Base + Bonus" hybrid incentive model, which we believe is a strong, real-world use case for Pyth Entropy.
The
ParamProtocol.solfile was intentionally designed to include theMockPTKtoken for simple, one-file testing in Remix.Thank you for reviewing!